package com.itheima.stock.config;

import com.itheima.stock.properties.IdWorkProperties;
import com.itheima.stock.util.IdWorkers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class IdWorkersConfiguration {
    @Bean
    public IdWorkers idWorkers(IdWorkProperties idWorkProperties){
        return new IdWorkers(idWorkProperties.getMachineId(),idWorkProperties.getDatacenterId());
    }
}
